<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>P164【例7-6】demo06.html</title>
</head>

<body>
    <script>
        var h2 = document.createElement('h2');
        var text = document.createTextNode('Hello JavaScript');
        var attr = document.createAttribute('align');
        arrt.value = 'center';
        h2.setAttributeNode(attr);
        h2.appendChild(text);
        document.body.append(h2);
    </script>
    <a href="../首页/page07.html">
        <h2>返回上一页面</h2>
    </a>
</body>

</html>